package cn.imvc.app.models;

import java.util.List;

import org.springframework.data.domain.Page;

import cn.imvc.app.entities.Dealer;
import cn.imvc.app.entities.Member;
import cn.imvc.data.domain.ViewRequest;

public interface DealerModel{
	Page<Dealer> find(ViewRequest viewRequest);

	Dealer get(int id);
	
	Dealer getByDomain(String domain);

	Dealer save(Dealer entity);

	Dealer update(Dealer entity);

	void delete(int id);

	void deleteBatch(int[] ids);
	
	Dealer findByMember(Member member);
	
	String updateQrcode(Member member);
	
	public List<Object[]> findMaxWxqrid();
	
	Dealer findByWxqrid(Integer wxqrid);
	
	/**
	 * 查询我的会员数量
	 * @param member
	 * @return
	 */
	List<Member> getMember(Member member);
	
	/**
	 * 查询我的团队数量
	 * @param member
	 * @return
	 */
	List<Object[]> getTeamCount(Member member);
	
	List<Member> getTeam(Member member);
	
	/**
	 * 查询我的经销商数量
	 * @param member
	 * @return
	 */
	List<Object[]> getDealerCount(Member member);
	
	/**
	 * 获取所有会员的总消费
	 * @param member
	 * @return
	 */
	List<Object[]> getTotalConsumption(Member member);
	
}